package com.ysh.bluetoothdemo.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.view.WindowManager;

import com.ysh.bluetoothdemo.R;

public class TaoHeartView extends View {

    public Context mcontext;
    public int screenWidth;

    public TaoHeartView(Context context) {
        super(context);
        mcontext = context;

    }

    public TaoHeartView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        mcontext = context;

    }


    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);

        WindowManager wm = (WindowManager) mcontext.getSystemService(Context.WINDOW_SERVICE);
        screenWidth = wm.getDefaultDisplay().getWidth();

        Paint paint = new Paint();
        paint.setColor(mcontext.getResources().getColor(R.color.start_blue));
        paint.setAntiAlias(true);
        paint.setStrokeWidth(5);
        paint.setStyle(Paint.Style.STROKE);

        Path path = new Path();
        path.moveTo(0,500);
        path.quadTo(screenWidth/2,300,-200,500);


    }

}
